home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / adx7mu1a / setup.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-06-14  |  4.8 KB  |  165 lines

  1. VERSION 5.00
  2. Begin VB.Form setup 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Set-Up"
  6.    ClientHeight    =   2385
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   4635
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   2385
  15.    ScaleWidth      =   4635
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   2  'CenterScreen
  18.    Visible         =   0   'False
  19.    Begin VB.ComboBox cominput 
  20.       Height          =   315
  21.       Left            =   2550
  22.       TabIndex        =   0
  23.       Text            =   "Combo1"
  24.       Top             =   210
  25.       Width           =   600
  26.    End
  27.    Begin VB.TextBox Text1 
  28.       Height          =   315
  29.       Left            =   2550
  30.       MaxLength       =   6
  31.       TabIndex        =   1
  32.       Top             =   600
  33.       Width           =   765
  34.    End
  35.    Begin VB.ComboBox list1 
  36.       Height          =   315
  37.       ItemData        =   "setup.frx":0000
  38.       Left            =   2550
  39.       List            =   "setup.frx":0002
  40.       Sorted          =   -1  'True
  41.       TabIndex        =   2
  42.       Text            =   "list1"
  43.       ToolTipText     =   "Enter Max Modem Speed"
  44.       Top             =   1020
  45.       Width           =   1200
  46.    End
  47.    Begin VB.CommandButton Command1 
  48.       Caption         =   "OK"
  49.       Height          =   435
  50.       Left            =   1620
  51.       TabIndex        =   3
  52.       Top             =   1740
  53.       Width           =   1470
  54.    End
  55.    Begin VB.Label Label5 
  56.       Alignment       =   1  'Right Justify
  57.       Caption         =   "Com Port Number"
  58.       Height          =   225
  59.       Left            =   870
  60.       TabIndex        =   6
  61.       Top             =   225
  62.       Width           =   1515
  63.    End
  64.    Begin VB.Label Label2 
  65.       Alignment       =   1  'Right Justify
  66.       Caption         =   "Your Name"
  67.       Height          =   225
  68.       Left            =   75
  69.       TabIndex        =   5
  70.       Top             =   630
  71.       Width           =   2310
  72.    End
  73.    Begin VB.Label Label1 
  74.       Alignment       =   1  'Right Justify
  75.       Caption         =   "Maximum Modem Speed"
  76.       Height          =   225
  77.       Left            =   75
  78.       TabIndex        =   4
  79.       Top             =   1110
  80.       Width           =   2310
  81.    End
  82. Attribute VB_Name = "setup"
  83. Attribute VB_GlobalNameSpace = False
  84. Attribute VB_Creatable = False
  85. Attribute VB_PredeclaredId = True
  86. Attribute VB_Exposed = False
  87. Private Sub Command1_Click()
  88. If Text1.Text = "" Then
  89.     MsgBox "Please Enter Your Name", vbOKOnly
  90.     Exit Sub
  91. ElseIf list1.Text = "" Then
  92.     MsgBox "Please Enter Your Maximum Modem Speed", vbOKOnly
  93.     Exit Sub
  94. ElseIf cominput.Text = "" Then
  95.     MsgBox "Please Select Your Com Port Number", vbOKOnly
  96.     Exit Sub
  97. End If
  98. 'inititate settings
  99. profilename = Text1.Text
  100. commnumber = cominput.Text
  101. maxspeed = list1.Text
  102. setupini = False
  103. 'saves reg settings
  104. SaveSetting App.Title, "Settings", "setup", setupini
  105. SaveSetting App.Title, "Settings", "profilename", profilename
  106. SaveSetting App.Title, "Settings", "Com Port", commnumber
  107. SaveSetting App.Title, "Settings", "Modem Speed", maxspeed
  108. MainBoard.Show
  109. Unload Me
  110. End Sub
  111. Private Sub Form_Load()
  112. 'checks for mainboard open and gets reg settings
  113. If MainBoard.Visible = False Then
  114.     setupini = GetSetting(App.Title, "Settings", "setup", True)
  115.     profilename = GetSetting(App.Title, "Settings", "profilename", "")
  116.     commnumber = GetSetting(App.Title, "Settings", "Com Port", "")
  117.     maxspeed = GetSetting(App.Title, "Settings", "Modem Speed", "")
  118. End If
  119. 'checks if needs to run setup
  120. If setupini = True Or profilename = "" Then
  121.     setup.Show
  122. ElseIf MainBoard.Visible = False Then
  123.   Unload Me
  124.   MainBoard.Show
  125. End If
  126. cominput.Text = commnumber
  127. list1.Text = maxspeed
  128. 'error checking for entries
  129. If profilename = "" Then
  130.     Label2.Caption = "Please Enter Your Name."
  131.     Label2.Caption = "Your Name"
  132.     Text1.Text = profilename
  133. End If
  134. 'populates combo boxes
  135. list1.AddItem "9600"
  136. list1.AddItem "14400"
  137. list1.AddItem "19200"
  138. list1.AddItem "28800"
  139. list1.AddItem "56000"
  140. cominput.AddItem "1"
  141. cominput.AddItem "2"
  142. cominput.AddItem "3"
  143. cominput.AddItem "4"
  144. cominput.AddItem "5"
  145. cominput.AddItem "6"
  146. End Sub
  147. Private Sub list1_Change() 'checks for list fill
  148. If Text1.Text > "" Then
  149.     If cominput.Text > "" Then
  150.         If list1.Text > "" Then
  151.             Command1.Enabled = True
  152.         End If
  153.     End If
  154. End If
  155. End Sub
  156. Private Sub Text1_Change() 'checks for text fill
  157. If Text1.Text > "" Then
  158.     If cominput.Text > "" Then
  159.         If list1.Text > "" Then
  160.             Command1.Enabled = True
  161.         End If
  162.     End If
  163. End If
  164. End Sub
  165.